﻿using System.IO;
using Styx;
using Styx.Helpers;
using System.ComponentModel;
using DefaultValue = Styx.Helpers.DefaultValueAttribute;
using Styx.Common;
using Styx.Common.Helpers;
using System.Reflection;

namespace KingWoW
{
    [Obfuscation(Exclude = true)] 
    public class RestorationShamanSettings : Settings
    {
        public static RestorationShamanSettings Instance = new RestorationShamanSettings();

        public string path_name = Path.Combine(Styx.Common.Utilities.AssemblyDirectory, string.Format(@"KingWOWCurrentSettings/RestorationShaman/RestorationShaman-Settings-{0}.xml", StyxWoW.Me.SafeName));

        public RestorationShamanSettings()
            : base(Path.Combine(Styx.Common.Utilities.AssemblyDirectory, string.Format(@"KingWOWCurrentSettings/RestorationShaman/RestorationShaman-Settings-{0}.xml", StyxWoW.Me.SafeName)))
        {
        }

        [Setting]
        [DefaultValue(250)]
        [Category("GHOST WOLF")]
        [DisplayName("MoveTimeForAutoGhostWulf")]
        [Description("autocast GhostWolf if you move without changing direction for a time greater than this value in Milliseconds")]
        public int MoveTimeForAutoGhostWulf { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("GHOST WOLF")]
        [DisplayName("AutoGhostWulf")]
        [Description("enable/disable autocast of GhostWolf")]
        public bool AutoGhostWulf { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("DPS")]
        [DisplayName("UseFlameShock")]
        [Description("enable/disable use of FlameShock (this has low priority)")]
        public bool UseFlameShock { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("DPS")]
        [DisplayName("UseFireTotems")]
        [Description("enable/disable use of FireTotems (this has low priority)")]
        public bool UseFireTotems { get; set; }
        

        [Setting]
        [DefaultValue(false)]
        [Category("DPS")]
        [DisplayName("UseLightningBolt")]
        [Description("enable/disable use of LightningBolt (this has low priority)")]
        public bool UseLightningBolt { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("DPS")]
        [DisplayName("UseLavaBurst")]
        [Description("enable/disable use of LavaBurst (this has low priority)")]
        public bool UseLavaBurst { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("DPS")]
        [DisplayName("UseChainLightning")]
        [Description("enable/disable use of ChainLightning (this has low priority)")]
        public bool UseChainLightning { get; set; }
        
        
        public enum TargetType
        {
            MANUAL,
            AUTO
        }

        [Setting]
        [DefaultValue(TargetType.AUTO)]
        [Category("TARGETTING")]
        [DisplayName("TargetTypeSelected")]
        [Description("AUTO/MANUAL enable/disable autotargeting")]
        public TargetType TargetTypeSelected { get; set; }    

        [Setting]
        [DefaultValue(true)]
        [Category("SPECIAL")]
        [DisplayName("AutoDismountOnCombat")]
        [Description("Auto start combat rotation when in combat and mounted")]
        public bool AutoDismountOnCombat { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SOS")]
        [DisplayName("UseSoS")]
        [Description("enable SoS healing: It require ANCESTRAL SWIFTNESS otherwise will cast a simple HEALING SURGE")]
        public bool UseSoS { get; set; }

        [Setting]
        [DefaultValue(35)]
        [Category("SOS")]
        [DisplayName("SoS HP%")]
        [Description("Cast SoS heal only if sos healing target hp% below this value")]
        public int SoSHP { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("MOVEMENT")]
        [DisplayName("AutoFacingTarget")]
        [Description("Enable/Disable autofacing current target")]
        public bool AutofaceTarget { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("MOVEMENT")]
        [DisplayName("Auto Move")]
        [Description("Enable/disable CC movement")]
        public bool movementEnabled { get; set; }

        [Setting]
        [DefaultValue(28)]
        [Category("PULL")]
        [DisplayName("PullDistance")]
        [Description("Distance to pull from")]
        public float PullDistance { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SELF HEALING")]
        [DisplayName("Enabled Self Healing Priority")]
        [Description("Enable/Disable Self Healing Priority: HP% is set below")]
        public bool SelfHealingPriorityEnabled { get; set; }

        [Setting]
        [DefaultValue(45)]
        [Category("SELF HEALING")]
        [DisplayName("SelfHealingPriorityHP")]
        [Description("if enabled Self Healing Priority: healing you before other in party until below this HP%")]
        public float SelfHealingPriorityHP { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("INTERRUPT")]
        [DisplayName("autointerrupt")]
        [Description("Cast WindShear if target casting")]
        public bool AutoInterrupt { get; set; }

        [Setting]
        [DefaultValue(200)]
        [Category("INTERRUPT")]
        [DisplayName("Interrupt_MIN_Time")]
        [Description("Interrupt if enemy cast time between Interrupt_MIN_Time and Interrupt_MAX_Time")]
        public int Interrupt_MIN_Time { get; set; }

        [Setting]
        [DefaultValue(300)]
        [Category("INTERRUPT")]
        [DisplayName("Interrupt_MAX_Time")]
        [Description("Interrupt if enemy cast time between Interrupt_MIN_Time and Interrupt_MAX_Time")]
        public int Interrupt_MAX_Time { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("CC")]
        [DisplayName("Use Hex")]
        [Description("Use Hex on focused target")]
        public bool UseHex { get; set; }
        

        [Setting]
        [DefaultValue(true)]
        [Category("DISPELLS")]
        [DisplayName("Use Dispell ")]
        [Description("enable/diable dispell")]
        public bool UseDispell { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SPECIAL")]
        [DisplayName("Use Resurrection")]
        [Description("enable use of Resurrection out of combat")]
        public bool UseResurrection { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("NPC_HEALING")]
        [DisplayName("HealNPC")]
        [Description("HealNPC")]
        public bool HealNPC { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("NPC_HEALING")]
        [DisplayName("FullHealSelectedNPC")]
        [Description("when HealNPC is selected if you enable this option then CR will try to full the selected friendly NPC you target")]
        public bool FullSelectedNPC { get; set; }

        [Setting]
        [DefaultValue(50)]
        [Category("SELF")]
        [DisplayName("Astral Shift HP%")]
        [Description("Cast Astral Shift if HP% lower than this value")]
        public int AS_HP { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SPECIAL")]
        [DisplayName("Autocast Spiritwalker's Grace")]
        [Description("enable use Autocast Spiritwalker's Grace when moving on combat (it is activated when CC found at least a player whith less than healing wave percent HP")]
        public bool Autocast_Spirit_Walk { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SPECIAL")]
        [DisplayName("Mantain TidalWaves buff")]
        [Description("Cast Riptide on lowest heal target if no tidalWaves buff active")]
        public bool MantainTidalWaves { get; set; }

        /*[Setting]
        [DefaultValue(true)]
        [Category("SPECIAL")]
        [DisplayName("UnleashLifeOnCD")]
        [Description("Cast UnleashLifeOnCD")]
        public bool UnleashLifeOnCD { get; set; }*/
        

        [Setting]
        [DefaultValue(98)]
        [Category("SPELLS HEAL TUNING")]
        [DisplayName("Riptide hp%")]
        [Description("Cast Riptide at target % hp")]
        public int RiptidePercent { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SPELLS HEAL TUNING")]
        [DisplayName("RiptideAlwaysUPOnTank")]
        [Description("Try to mantain Riptide always UP on tank")]
        public bool RiptideAlwaysUPOnTank { get; set; }

        [Setting]
        [DefaultValue(90)]
        [Category("SPELLS HEAL TUNING")]
        [DisplayName("HealingWave hp%")]
        [Description("Cast HealingWave at target % hp")]
        public int HealingWavePercent { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("MANA MANAGEMENT")]
        [DisplayName("TrySaveMana")]
        [Description("Try save mana: interrupt no needed heal")]
        public bool TrySaveMana { get; set; }

        /*[Setting]
        [DefaultValue(true)]
        [Category("MANA MANAGEMENT")]
        [DisplayName("LIGHTNING_BOLT to rec mana (only glyphed)")]
        [Description("Cast LIGHTNING_BOLT in no other heal needed to rec mana: used ONLY if \"Telluric Currents\" glyphed")]
        public bool LB_for_rec_mana { get; set; }*/
        

        [Setting]
        [DefaultValue(false)]
        [Category("AOE")]
        [DisplayName("DisableAOE_HealingRotation")]
        [Description("Enable/disable AOE healing")]
        public bool DisableAOE_HealingRotation { get; set; }
        

        [Setting]
        [DefaultValue(98)]
        [Category("AOE")]
        [DisplayName("Healing Rain hp%")]
        [Description("Cast Healing Rain if Player below %h >= #HealingRainNumber")]
        public int HealingRainPercent { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("AOE")]
        [DisplayName("HealingRainOnlyOnMouseLocation")]
        [Description("Use Healing Rain ONLY manually: cast it on current mouse position using hotkey")]
        public bool HealingRainOnlyOnMouseLocation { get; set; }
        

        [Setting]
        [DefaultValue(4)]
        [Category("AOE")]
        [DisplayName("Healing Rain players number")]
        [Description("Cast Healing Rain if Player below HealingRainPercent >= this number")]
        public int HealingRainNumber { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("AOE")]
        [DisplayName("HealingRainOnlyOnTankLocation")]
        [Description("Cast Healing Rain only on tank location if condition verified")]
        public bool HealingRainOnlyOnTankLocation { get; set; }

        [Setting]
        [DefaultValue(40)]
        [Category("SPELLS HEAL TUNING")]
        [DisplayName("Healing Surge hp%")]
        [Description("Cast Healing Surge at target % hp")]
        public int HealingSurgePercent { get; set; }

        [Setting]
        [DefaultValue(80)]
        [Category("AOE")]
        [DisplayName("Chain Heal hp%")]
        [Description("Cast Chain Heal if player lower than % hp >= ChainHealNumber")]
        public int ChainHealPercent { get; set; }

        [Setting]
        [DefaultValue(4)]
        [Category("AOE")]
        [DisplayName("Chain Heal players number")]
        [Description("Cast Chain Heal if player lower than ChainHealPercent >= this value")]
        public int ChainHealNumber { get; set; }

        [Setting]
        [DefaultValue(90)]
        [Category("T17 Bonus")]
        [DisplayName("BonusChainHeal hp%")]
        [Description("if Harmony of the Elements procs then Cast Chain Heal if player lower than % hp >= ChainHealNumber")]
        public int ChainHealPercentT17 { get; set; }

        [Setting]
        [DefaultValue(2)]
        [Category("T17 Bonus")]
        [DisplayName("BonusChainHeal players number")]
        [Description("if Harmony of the Elements procs then Cast Chain Heal if player lower than ChainHealPercent >= this value")]
        public int ChainHealNumberT17 { get; set; }

        /*[Setting]
        [DefaultValue(false)]
        [Category("AOE")]
        [DisplayName("ChainHealOnlyFromTank")]
        [Description("Cast Chain heal only from tank location if condition verified")]
        public bool ChainHealOnlyFromTank { get; set; }*/

        [Setting]
        [DefaultValue(50)]
        [Category("AOE")]
        [DisplayName("Spirit Link hp%")]
        [Description("Cast Spirit Link if player lower than % hp >= SpiritLinkNumber")]
        public int SpiritLinkPercent { get; set; }

        [Setting]
        [DefaultValue(5)]
        [Category("AOE")]
        [DisplayName("Spirit Link players number")]
        [Description("Cast Spirit Link if player lower than SpiritLinkPercent >= this value")]
        public int SpiritLinkNumber { get; set; }

        [Setting]
        [DefaultValue(40)]
        [Category("REST")]
        [DisplayName("Drink mana%")]
        [Description("Drink at % mana")]
        public int ManaPercent { get; set; }

        [Setting]
        [DefaultValue(40)]
        [Category("REST")]
        [DisplayName("Eat hp%")]
        [Description("Eat at % hp")]
        public int HealthPercent { get; set; }

        public enum healingTotemCastType
        {
            ALWAYS,
            AT_CONDITION,
            MANUAL
        }

        public enum cloudburstTotemCastType
        {
            ALWAYS,
            MANUAL
        }

        /*[Setting]
        [DefaultValue(healingTotemCastType.ALWAYS)]
        [Category("CLOUDBURST_TOTEM")]
        [DisplayName("WhenCastCloudBurstTotem")]
        [Description("Always will cast on cooldown when healing stream totem expiring")]
        public healingTotemCastType WhenCastCloudBurstTotem { get; set; }*/

        [Setting]
        [DefaultValue(healingTotemCastType.ALWAYS)]
        [Category("STREAM_TOTEM")]
        [DisplayName("WhenCastStreamTotem")]
        [Description("Always will cast on cooldown, conditios will cast stream totem when heal percent and number verified")]
        public healingTotemCastType WhenCastStreamTotem { get; set; }

        [Setting]
        [DefaultValue(95)]
        [Category("STREAM_TOTEM")]
        [DisplayName("Stream Totem hp%")]
        [Description("Cast Stream Totem if player lower than % hp >= StreamTotemNumber")]
        public int StreamTotemPercent { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("STREAM_TOTEM")]
        [DisplayName("Stream Totem players number")]
        [Description("Cast Stream Totem if player lower than StreamTotemPercent >= this value")]
        public int StreamTotemNumber { get; set; }

        [Setting]
        [DefaultValue(60)]
        [Category("HEALING_TIDE_TOTEM")]
        [DisplayName("HealingTideTotem hp%")]
        [Description("Cast Stream Totem if player lower than % hp >= StreamTotemNumber")]
        public int HealingTideTotemPercent { get; set; }

        [Setting]
        [DefaultValue(5)]
        [Category("HEALING_TIDE_TOTEM")]
        [DisplayName("HealingTideTotem players number")]
        [Description("Cast HealingTideTotem if player lower than StreamTotemPercent >= this value")]
        public int HealingTideTotemNumber { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SPECIAL")]
        [DisplayName("use OOC healing")]
        [Description("enable-disable use of OutOfCombat healing")]
        public bool OOCHealing { get; set; }

        [Setting]
        [DefaultValue(60)]
        [Category("SPECIAL")]
        [DisplayName("ElementalBlastHP")]
        [Description("Use Elemental Blast only if noone in range of healing is below this value of HP percentage")]
        public int ElementalBlastHP { get; set; }
        

        public enum CDUseType
        {
            COOLDOWN,
            BOSS,
            MANUAL
        }

        [Setting]
        [DefaultValue(CDUseType.COOLDOWN)]
        [Category("CD")]
        [DisplayName("Use Elemental Mastery")]
        [Description("Chose when use your Elemental Mastery CD")]
        public CDUseType ElementalMasteryCD { get; set; }


        [Setting]
        [DefaultValue(CDUseType.COOLDOWN)]
        [Category("CD")]
        [DisplayName("Use Ascendance")]
        [Description("Chose when use your Ascendance CD")]
        public CDUseType AscendanceCD { get; set; }

        [Setting]
        [DefaultValue(CDUseType.BOSS)]
        [Category("CD")]
        [DisplayName("Use Fire/Earth Elemental")]
        [Description("Chose when use your Fire/Earth Elemental CD")]
        public CDUseType ElementalCD { get; set; }

        [Setting]
        [DefaultValue(50)]
        [Category("CD")]
        [DisplayName("AscendanceHP")]
        [Description("cast Ascendance if AT_CONDITION choosen and AscendanceNumber players below this value HP% verified ")]
        public int AscendanceHP { get; set; }

        [Setting]
        [DefaultValue(5)]
        [Category("CD")]
        [DisplayName("AscendanceNumber")]
        [Description("cast Ascendance if AT_CONDITION choosen and players below AscendanceHP number high or equal this number verified ")]
        public int AscendanceNumber { get; set; }




        [Setting]
        [DefaultValue(60)]
        [Category("CD")]
        [DisplayName("Fire/Heart_ElementalHP")]
        [Description("cast Fire/Heart_Elemental if AT_CONDITION choosen and Fire/Heart_ElementalNumber players below this value HP% verified ")]
        public int ElementalHP { get; set; }

        [Setting]
        [DefaultValue(5)]
        [Category("CD")]
        [DisplayName("Fire/Heart_ElementalNumber")]
        [Description("cast Fire/Heart_Elemental if AT_CONDITION choosen and players below Fire/Heart_ElementalHP number high or equal this number verified ")]
        public int ElementalNumber { get; set; }

        [Setting]
        [DefaultValue(60)]
        [Category("CD")]
        [DisplayName("ElementalMasteryHP")]
        [Description("cast ElementalMastery if AT_CONDITION choosen and ElementalMasteryNumber players below this value HP% verified ")]
        public int ElementalMasteryHP { get; set; }

        [Setting]
        [DefaultValue(5)]
        [Category("CD")]
        [DisplayName("ElementalMasteryNumber")]
        [Description("cast ElementalMastery if AT_CONDITION choosen and players below ElementalMasteryHP number high or equal this number verified ")]
        public int ElementalMasteryNumber { get; set; }     

        [Setting]
        [DefaultValue(false)]
        [Category("TOTEM AIR")]
        [DisplayName("Use Capacitor Totem")]
        [Description("Enable/disable use of Capacitor Totem")]
        public bool UseCapacitorTotem { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("TOTEM AIR")]
        [DisplayName("Use Grounding Totem")]
        [Description("Enable/disable use of CapGroundingacitor Totem")]
        public bool UseGroundingTotem { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("TOTEM AIR")]
        [DisplayName("Use WindWalk Totem")]
        [Description("Enable/disable use of WindWalk Totem")]
        public bool UseWindWalkTotem { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("TOTEM EARTH")]
        [DisplayName("Use EarthBind Totem")]
        [Description("Enable/disable use of EarthBind Totem")]
        public bool UseEarthBindTotem { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("TOTEM EARTH")]
        [DisplayName("Use Tremor Totem")]
        [Description("Enable/disable use of Tremor Totem")]
        public bool UseTremorTotem { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("TOTEM EARTH")]
        [DisplayName("Use EarthGrab Totem")]
        [Description("Enable/disable use of EarthGrab Totem")]
        public bool UseEarthGrabTotem { get; set; }
    }
}